// const userRepository = require('../dataAccess/userRepository');

const apiKey = "sk-8bad29d07e6948df8196ef1ddc96512b";
const baseURL = "https://api.deepseek.com"
const modelChat = "deepseek-chat";
const rule_user = "user"; // 用户角色
const role_assistant = "assistant"; // 智能角色
const role_system = "system"; // 系统角色

const OpenAI = require("openai");
const openai = new OpenAI({
    baseURL: baseURL,
    apiKey: apiKey
});

// 对话补全
const sendChat = async (content) => {
    return await openai.chat.completions.create({
        messages: [{ role: rule_user, content: content }],
        model: modelChat,
    });
};

module.exports = {
    sendChat
};
